

do "prepare data.do"
	*firm-level manufacturing indicator
	*converts Rauch indicator of diff goods from SITC to HS6
	**output: Rauch_hs6_concordance
	*identifies peg countries
	*output: data/usd_peg 
	**0/1 dummy to indicate usd peg, based on rmse<0.05 for 2012 to 2018
	

do "AggTradeData_HS4_country.do"
	*input: rawdata/trade_20XX.dta
	*output: X_hs4_2012_2019.dta and M_hs4_2012_2019.dta
	**data to be used in the denominator of the market share variable

do "phi.do"
	*prepares phi_xeu

do "phi_euro.do"
	*splits phi_xeu into currency components
	*checks match with import data to work out which phi are zero or missing for the set of exporters with currency data
	
do "prepare currency variables.do"
	*firm-destination indicators of currency variables


do "competitor_currency.do"
	*competitor currency euro vs other and dollar vs other for exporters
	*competitor currency euro vs other for importers

	
do "prepare_instrument_comtrade.do"
	*input: rawdata/20XX_H2012_exports
	*output: data/2017_2019_comtrade_US_hs_exp (and _imp)
	**instruments for nonBelgium competitors in currency choice regs average 2017-2019	

do "competitor_instruments.do"
	*input: ../data/mphi_xeu_currency and ../data/memp
	*output: ../data/comp_instruments
	**instrument for Belgium competitors - average employment and average phi
	
do "prepare additional variables.do"	
	*at firmlevel: tfp index, export shares, RD,
	*and financial variables: cash_STdebt, leverage, coverage tot_assets
	*output: data/Additional_Variables for all firm-level variables
	*at country level: 
	*at industry level from comtrade: ../data/exports_hs4

do "import currency variables.do"
	*combines data for import currency appendix table regressions.







